<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<style>
.error {
	color: #ff0000;
	font-style: normal;
	font-weight: bold;
}

#lewa {
	margin: 0px;
	border: none;
	padding: 0px;
	width: 540px;
	float: left;
}

#prawa {
	margin: 0px;
	border: none;
	padding: 0px;
	width: 540px;
	float: right;
}

#center {
	margin: 30px;
	border: none;
	padding-top: 250px;
	width: 660px;
	float: center;
}

#kryt {
	margin: 0px;
	border: none;
	padding: 30px;
	width: 200px;
	float: left;
}

#sort {
	margin: 0px;
	border: none;
	padding:30px;
	width: 200px;
	float: left;
}

#sortright {
	margin: 0px;
	border: none;
	padding: 30px;
	width: 400px;
	float: left;


}

ol {
  list-style-type:none;
  padding:0;
  margin:0;
  font-size:18px;
  height:2em;
  line-height:2em;
  text-align:center;
}


ol > li {
  float:left;
  background-color:#FDD700;
  width:150px;
}
</style>
</head>
<body bgcolor="#F5F4DA">
	<c:url value="/j_spring_security_logout" var="logoutUrl" />

	<!-- csrt for log out-->
	<form action="${logoutUrl}" method="post" id="logoutForm">
		<input type="hidden" name="${_csrf.parameterName}"
			value="${_csrf.token}" />
	</form>

	<script>
		function formSubmit() {
			document.getElementById("logoutForm").submit();
		}
	</script>

	<c:if test="${pageContext.request.userPrincipal.name != null}">
		<h2>Jestes zalogowany jako: ${pageContext.request.userPrincipal.name}</h2>
	</c:if>
	

 <ol>
    <li><a href="register">dodaj studenta</a></li>
    <li><a href="users">tabela</a></li>
    <li><a href="pdf">PDF</a></li>
    <li><a href="/jee/">Strona glowna</a></li>
    <li><a href="javascript:formSubmit()"> Wyloguj sie</a></a></li>
  </ol>
<c:if test="${!empty employeeList}">
		<table class="data">
			<tr>
				<th>Imie</th>
				<th>Email</th>
				<th>Login</th>
				<th>Haslo</th>
				<th>Telefon</th>
				<th>PESEL</th>
				<th>Plec</th>
				<th>Data urodzenia</th>
				<th>Miejsce urodzenia</th>
				<th>Szkola srednia</th>
				<th>Kierunek</th>
				<th>Suma pkt</th>
				<th>Status</th>
				<th>Akcja</th>
			</tr>
			<c:forEach items="${employeeList}" var="emp">
				<tr>
					<td>${emp.firstname}, ${emp.lastname}</td>
					<td>${emp.email}</td>
					<td>${emp.username}</td>
					<td>${emp.password}</td>
					<td>${emp.telephone}</td>
					<td>${emp.pesel}</td>
					<td>${emp.sex}</td>
					<td>${emp.birthday.getDate()}/${emp.birthday.getMonth()}/${emp.birthday.getYear()}</td>
					<td>${emp.birthplace}</td>
					<td>${emp.school}</td>
					<td>${emp.direction}</td>
					<td>${emp.sum}</td>
					<td>${emp.status}</td>
					<td><a href="delete/${emp.id}">usun </a> <a
						href="edit/${emp.id}"> pobierz</a> <a href="accept/${emp.id}">
							przyjmij</a>
					</td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
	<h2>Formularz do edycji</h2>
	<form:form method="post" action="/jee/add" commandName="employee">

		<tr>
			<form:hidden path="id" />
		</tr>
		<div id="lewa">
			<table>
				<tr>
					<td><form:label path="username">
							<spring:message code="label.username" />
						</form:label>
					</td>
					<td><form:input path="username" />
					</td>
					<td><form:errors path="username" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td><form:label path="password">
							<spring:message code="label.password" />
						</form:label>
					</td>
					<td><form:input path="password" />
					</td>
					<td><form:errors path="password" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td><form:label path="firstname">
							<spring:message code="label.firstname" />
						</form:label>
					</td>
					<td><form:input path="firstname" />
					</td>
					<td><form:errors path="firstname" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td><form:label path="lastname">
							<spring:message code="label.lastname" />
						</form:label>
					</td>
					<td><form:input path="lastname" />
					</td>
					<td><form:errors path="lastname" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Plec</td>
					<td><form:select path="sex">
							<form:option value="M" label="Mezczyzna" />
							<form:option value="K" label="Kobieta" />
						</form:select>
					</td>
				</tr>
				<tr>
					<td>Miejsce urodzenia</td>
					<td><form:input path="birthplace" />
					</td>
					<td><form:errors path="birthplace" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Data urodzenia</td>
					<td><form:input path="birthday" placeholder="MM/dd/yyyy" />
					</td>
					<td><form:errors path="birthday" cssClass="error" />
					</td>
				</tr>
			</table>
		</div>
		<div id="prawa">
			<table>

				<tr>
					<td><form:label path="email">
							<spring:message code="label.email" />
						</form:label>
					</td>
					<td><form:input path="email" />
					</td>
					<td><form:errors path="email" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td><form:label path="telephone">
							<spring:message code="label.telephone" />
						</form:label>
					</td>
					<td><form:input path="telephone" />
					</td>
					<td><form:errors path="telephone" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td><form:label path="pesel">
							<spring:message code="label.pesel" />
						</form:label>
					</td>
					<td><form:input path="pesel" />
					</td>
					<td><form:errors path="pesel" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Secondary school</td>
					<td><form:input path="school" />
					</td>
					<td><form:errors path="school" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Direction</td>
					<td><form:input path="direction" />
					</td>
					<td><form:errors path="direction" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Matematyka</td>
					<td><form:input path="first" />
					</td>
					<td><form:errors path="first" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Jezyk polski</td>
					<td><form:input path="second" />
					</td>
					<td><form:errors path="second" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Przedmiot rozszerzony</td>
					<td><form:input path="third" />
					</td>
					<td><form:errors path="third" cssClass="error" />
					</td>
				</tr>
				<tr>
					<td>Status</td>
					<td><form:input path="status" />
					</td>
					<td><form:errors path="status" cssClass="error" />
					</td>
				</tr>

			</table>
		</div>
		<div id="center">
			<tr>
				<td colspan="2"><input type="submit"
					value="zmien" /></td>
			</tr>
		</div>


	</form:form>
	<div id="kryt">
		<h2>Raport</h2>
		<form name='criteriaform' action="<c:url value='/criteria' />"
			method='POST'>
			<table>
				<tr>
					<td>kryterium</td>
					<td><input type='text' name='kryteria' value=''>
					</td>
				</tr>
				<tr>
					<td>nazwa</td>
					<td><input type='text' name='nazwa' />
					</td>
				</tr>
				<tr>
					<td><input name="submit" type="submit" value="szukaj" />
					</td>

				</tr>
			</table>

		</form>
	</div>
	<div id="sort">
		<h2>Prog</h2>
		<form name='sortform' action="<c:url value='/sort' />" method='POST'>
			<table>
				<tr>
					<td>kierunek</td>
					<td><select name="direction" multiple="true">
							<option value="informatyka">informatyka</option>
							<option value="zarzadzanie">zarzadzanie</option>
							<option value="mechanika">mechanika</option>
							<option value="budownictwo">budownictwo</option>
							<option value="mechatronika">mechatronika</option>
					</select></td>


				</tr>
				<tr>
					<td>prog punktowy</td>
					<td><input type='text' name='points' />
					</td>
				</tr>
				<tr>
					<td><input name="submit" type="submit" value="wyswietl" />
					</td>

				</tr>
			</table>

		</form>
	</div>
	<div id="sortright">
		<h2>Ilosc wynikow</h2>
		<form name='wynikiform' action="<c:url value='/wyniki' />"
			method='POST'>
			<table>
				<tr>
					<td>kierunek</td>
					<td><select name="direction" multiple="true">
							<option value="informatyka">informatyka</option>
							<option value="zarzadzanie">zarzadzanie</option>
							<option value="mechanika">mechanika</option>
							<option value="budownictwo">budownictwo</option>
							<option value="mechatronika">mechatronika</option>
					</select></td>


				</tr>
				<tr>
					<td>ile wynikow</td>
					<td><input type='text' name='ilosc' />
					</td>
				</tr>
				<tr>
					<td><input name="submit" type="submit" value="wyswietl" />
					</td>

				</tr>
			</table>

		</form>
	</div>
	
	
</body>
</html>